<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 
 <script type="text/javascript" src="js/jquery.min.js"></script>
<body>


<!-- <input id="name"><input type="button" id="btn" value="提交"> -->
<!-- <script type="text/javascript">	
$(function(){  		
	$("#btn").click(function(){  		
		var name=$("#name").val();  			
		localStorage.setItem("name", name); 		
		});  	
	});  
	</script> -->
	
	
	
<input id="name">
<input type="button" id="btn" value="提交"> <br>
<input id="name2">
<input type="button" id="btn2" value="提交">
<script type="text/javascript">
	$(function(){  
		$("#btn").click(function(){  
			var name=$("#name").val();  
			document.cookie="name="+name;  
		});  
		$("#btn2").click(function(){  
			var name=$("#name2").val();  
			document.cookie="name="+name;  
		});  
	});  
</script>
</body>
</html>